home *** CD-ROM | disk | FTP | other *** search
/ Best of www.BestZips.com (Collector's Edition) / Best of WWW.BESTZIPS.COM Collector's Edition (JCSM Shareware) (JCS Marketing).ISO / prgtools / prtsut53.zip / SU1SRC.ZIP / REPDEM08.PAS < prev    next >
Pascal/Delphi Source File  |  1996-12-03  |  1KB  |  60 lines

  1. unit Repdem08;
  2.  
  3. interface
  4.  
  5. uses
  6.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  7.   StdCtrls, Forms, DBCtrls, DB, DBGrids, Buttons, DBTables, Grids,
  8.   ExtCtrls, Printers, PrnGridR,  CB_Types, CB_MFunc;
  9.  
  10. type
  11.   Tdem08form = class(TForm)
  12.     DBGrid1: TDBGrid;
  13.     Panel1: TPanel;
  14.     DataSource1: TDataSource;
  15.     Panel2: TPanel;
  16.     Query1: TQuery;
  17.     Label1: TLabel;
  18.     Label2: TLabel;
  19.     Preview: TBitBtn;
  20.     Exit: TBitBtn;
  21.     Label3: TLabel;
  22.     PrintGridReport1: TPrintGridReport;
  23.     procedure FormCreate(Sender: TObject);
  24.     procedure PreviewClick(Sender: TObject);
  25.   private
  26.     { private declarations }
  27.   public
  28.   end;
  29.  
  30. var
  31.   dem08form: Tdem08form;
  32.  
  33. implementation
  34.  
  35. {$R *.DFM}
  36.  
  37. procedure Tdem08form.FormCreate(Sender: TObject);
  38. begin
  39.   Query1.Open;
  40.  
  41.   { SubTotals will be on field Continent}
  42.   PrintGridReport1.SetSubTotalField(1, 'Continent','Continent');
  43.  
  44. end;
  45.  
  46. procedure Tdem08form.PreviewClick(Sender: TObject);
  47. begin
  48.     Query1.DisableControls;
  49.  
  50.     { Force Orientation to Portrait }
  51.     PrintGridReport1.Orientation := Portrait;
  52.  
  53.    { and send query for preview }
  54.     PrintGridReport1.Execute;
  55.    Query1.EnableControls;
  56. end;
  57.  
  58.  
  59. end.
  60.